<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePublishingTradeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('trade_activities', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title')->comment('活动名称');
            $table->string('image')->comment('专题图');
            $table->string('link')->comment('链接');
            $table->date('date_time')->comment('活动时间');
            $table->timestamps();
        });

        Schema::create('trade_recommends', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('product_id')->comment('产品id');
            $table->timestamps();
        });

        Schema::create('company_profile', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('公司名字');
            $table->text('summary')->comment('简介');
            $table->string('address')->comment('地址');
            $table->string('telephone')->comment('联系电话');
            $table->string('fax')->comment('传真');
            $table->string('email')->comment('邮箱');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('trade_activities');
        Schema::dropIfExists('trade_recommends');
        Schema::dropIfExists('company_profile');
    }
}
